package com.atguigu.gmall.publisher.mapper;


import com.atguigu.gmall.publisher.beans.TradeProvinceOrderAmount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.math.BigDecimal;

/*
*
*   交易域统计mapper接口
*
*
* */
@Mapper
public interface TradeStatesMapper {
    //获取某天的总交易额
    @Select("select sum(final_amount) as sum_amount from dws_trade_province_order_window where toYYYYMMDD(stt)=#{date}")
    BigDecimal selectGMV(Integer date);

    //获取某天的不同的省份交易额
    @Select("select province_name,sum(final_amount) as sum_amount from dws_trade_province_order_window where toYYYYMMDD(stt)=#{date} group by province_name")
    List<TradeProvinceOrderAmount> selectProvinceAmount(Integer date);

}
